package com.mastercard.labs

import static org.junit.Assert.*

import grails.test.mixin.*
import grails.test.mixin.support.*
import org.junit.*
import grails.test.mixin.TestFor
import org.apache.shiro.SecurityUtils
import org.apache.shiro.authc.AuthenticationException
import org.apache.shiro.authc.UsernamePasswordToken
import org.apache.shiro.web.util.SavedRequest
import org.apache.shiro.web.util.WebUtils
import cr.co.arquetipos.crypto.Blowfish

/**
 * See the API for {@link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions
 */
@TestMixin(GrailsUnitTestMixin)
@TestFor(DashboardController)
class DashboardControllerTests {
	def authController = new AuthController()
    void setUp() {
        // Setup logic here
		println "setup..."
		params.username = "ZHONGDE"
		params.password = "d"
		params.rememberMe = true;
		authController.signIn()
	
    }

    void tearDown() {
        // Tear down logic here
    }

    void testIndex() {
		log.info "setup..."
		new org.apache.shiro.grails.ShiroSecurityService()
		params.username = "ZHONGDE"
		params.password = "d"
		params.rememberMe = true;
		authController.signIn()
		controller.index()
		assert view == "/dashboard/dashboard"
    }
}
